package cn.t222.mapper;

import cn.t222.pojo.SysResources;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@Mapper
@CacheConfig(cacheNames = "resource-dao")
public interface SysResourcesMapper extends AbstractMapper<SysResources,Integer>{
    List<SysResources> getAllByUsername(String username);

    List<SysResources> getAllByRoleId(Integer roleId);

    int delRoleResources(Integer roleId);

    int addRoleResources(@Param("roleId") Integer roleId,
                         @Param("resourceId") Integer resourceId);

    List<SysResources> getAllButtonPermissions(@Param("username")String username,
                                               @Param("modulePath")String modulePath);
}
